#include <unistd.h>
#include<stdio.h>
#include<time.h>
#include <string.h>
int main()
{
int i = 0;
srand(time(NULL));
char bar[102];
memset(bar, 0 ,sizeof(bar));
const char *lable="|/-\\";
while(i <= 100 ){
printf("[%-100s][%d%%][%c]\r", bar, i, lable[i%4]);
fflush(stdout);
bar[i++] = '=';
if(i<90)
usleep(rand()%300000+100);
else
usleep(10000);
}
printf("\n");
return 0;
}
